<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ajax_count extends Front_Controller{	

	function __construct(){
		parent::__construct();
	}
	
	function index(){
		$id = $this->uri->segment(4);
		$isUpdata = $this->uri->segment(5,0);
		
		$count = $this->JayphaDB->getDBValue('click',$this->db_table_prefix.'archives',array('id'=>$id),'');
		if($isUpdata=='1') $this->JayphaDB->updateDB(array('click'=>$count+1),$this->db_table_prefix.'archives',array('id'=>$id));
		echo "document.write($count);";
	}
}